package AbstractFactoryMethodPattern.FactoryMethodExample.cellphone;

import AbstractFactoryMethodPattern.FactoryMethodExample.cpu.QualcommCpu;
import AbstractFactoryMethodPattern.FactoryMethodExample.framework.Product;

public class Galaxy extends Product {
    private final String name;
    private final QualcommCpu cpu;

    public Galaxy(String name, QualcommCpu cpu) {
        this.name = name;
        this.cpu = cpu;
    }

    @Override
    public void use() {
        System.out.println("Galaxy : " + name + " is working");
        cpu.use();
    }
}